const getDateBefore = function (baseDay, beforeDays) {
  baseDay.setDate(baseDay.getDate() + beforeDays)
  let y = baseDay.getFullYear()
  let m = baseDay.getMonth() + 1
  let d = baseDay.getDate()

  if (m < 10) {
    m = `0${m}`
  }

  if (d < 10) {
    d = `0${d}`
  }
  return y + '-' + m + '-' + d
}

export default {
  getDateBefore
}
